#pragma GCC optimize(2)
#include <iostream>
#include <algorithm>
#include <cstring>
#include <string>
#include <map>
#include <vector>

using namespace std;
using LL = long long;

string s;

int main(){
    freopen("in.txt", "r", stdin);
    freopen("out.txt", "w", stdout);
    ios::sync_with_stdio(false);
    cin.tie(nullptr);

    cin >> s;

    int cnt = 0;
    for(int i = 0; i < s.length(); i ++){
        if(s[i] != '0'){
            cnt ++;
        }else{
            if(i + 1 < s.length() && s[i + 1] == '0'){
                i ++;
                cnt ++;
                continue;
            }
            cnt ++;
        }
    }

    cout << cnt << endl;

    return 0;
}